//
//  orderCell.m
//  UHealth
//
//  Created by hanyou on 15/3/18.
//  Copyright (c) 2015年 gjtx. All rights reserved.
//

#import "orderCell.h"
#import "UIImageView+WebCache.h"

@implementation orderCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setData:(NSDictionary *)dataDict{
    NSString *orderImgStr       = dataDict[@"appfile"];//图片
    NSString *ordernameStr      = dataDict[@"shop_name"];//名字
    NSString *orderPriceStr     = dataDict[@"saleprice"] ;//价格
    NSString *orderCountStr     = dataDict[@"buynum"];//数量
    NSString *orderStateStr     = dataDict[@"order_status"];//状态
    
    
    [self.orderImg sd_setImageWithURL:[NSURL URLWithString:orderImgStr] placeholderImage:[UIImage imageNamed:@"pic2"]];
    self.ordername.text         = ordernameStr;
    self.orderPrice.text        = [NSString stringWithFormat:@"%@:%@",kLocal(@"unit_price"),orderPriceStr];
    self.orderCount.text        = [NSString stringWithFormat:@"%@:%@",kLocal(@"total_num"),orderCountStr];;
    if ([orderStateStr isEqualToString:@"已购买"]) {
        self.orderState.text        = kLocal(@"have_buy");
        self.orderState.textColor   = [UIColor grayColor];
        self.orderState.backgroundColor = [UIColor clearColor];
    }else{
        self.orderState.text        = kLocal(@"pay");
        self.orderState.textColor   = [UIColor whiteColor];
        self.orderState.backgroundColor = kBlueColor;
    }

}

@end
